package IDict

type Consumer func(key string, val interface{}) bool

type Dict interface {
	Get(key string) (val interface{}, exists bool)
	Len() int
	Put(key string, val interface{}) (result int)
	PutIfAbsent(key string, val interface{}) (result int)
	PutIfExist(key string, val interface{}) (result int)
	Remove(key string) (result int)
	ForEach(consumer Consumer)
	Keys() []string
	RandomKeys(limit int) []string

	//
	// RandomDistinctKeys
	//  @Description: 随机返回key不同的键
	//  @param limit
	//  @return []string
	//
	RandomDistinctKeys(limit int) []string
	//
	// clear
	//  @Description: 清空字典
	//
	Clear()
}
